<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<html>
	<head>
		<title>Login Page</title>
		<script src="resources/js/login/login.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				loadLoginPage();
			});
		</script>
	</head>

	<body>
		<div id="login-dialog-form" title="Login">
			<form:form id="login-form" method="post">
			<fieldset>
				<label for="username">Username: </label><br />
				<input type="text" id="username" name="username" class="text ui-widget-content ui-corner-all"/><br />
				
				<label for="password">Password: </label><br />
				<input type="password" id="password" name="password" class="text ui-widget-content ui-corner-all"/><br />
			</fieldset>
			</form:form>
			
			<c:if test="${not empty errorMessage}">
				<div id="error" class="ui-state-error ui-corner-all">
					<span id="error-icon" class="ui-icon ui-icon-alert"></span>
					Your login attempt was not successful, try again.<br /> 
					Caused : ${errorMessage}
					<script>
						$( "#login-dialog-form" ).dialog( "option", "show", "highlight" );
					</script>
				</div>
			</c:if>
		</div>
	</body>
</html>